

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>llvm-build - LLVM Project Build Utility &#8212; LLVM 9 documentation</title>
    <link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="llvm-exegesis - LLVM Machine Instruction Benchmark" href="llvm-exegesis.html" />
    <link rel="prev" title="lit - LLVM Integrated Tester" href="lit.html" />
<style type="text/css">
  table.right { float: right; margin-left: 20px; }
  table.right td { border: 1px solid #ccc; }
</style>

  </head><body>
<div class="logo">
  <a href="../index.html">
    <img src="../_static/logo.png"
         alt="LLVM Logo" width="250" height="88"/></a>
</div>

    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="llvm-exegesis.html" title="llvm-exegesis - LLVM Machine Instruction Benchmark"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="lit.html" title="lit - LLVM Integrated Tester"
             accesskey="P">previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="../index.html">Documentation</a>&raquo;</li>

          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">LLVM Command Guide</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">llvm-build - LLVM Project Build Utility</a></li> 
      </ul>
    </div>


    <div class="document">
      <div class="documentwrapper">
          <div class="body" role="main">
            
  <div class="section" id="llvm-build-llvm-project-build-utility">
<h1>llvm-build - LLVM Project Build Utility<a class="headerlink" href="#llvm-build-llvm-project-build-utility" title="Permalink to this headline">¶</a></h1>
<div class="section" id="synopsis">
<h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<p><strong>llvm-build</strong> [<em>options</em>]</p>
</div>
<div class="section" id="description">
<h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p><strong>llvm-build</strong> is a tool for working with LLVM projects that use the LLVMBuild
system for describing their components.</p>
<p>At heart, <strong>llvm-build</strong> is responsible for loading, verifying, and manipulating
the project’s component data. The tool is primarily designed for use in
implementing build systems and tools which need access to the project structure
information.</p>
</div>
<div class="section" id="options">
<h2>OPTIONS<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
<p><strong>-h</strong>, <strong>–help</strong></p>
<blockquote>
<div><p>Print the builtin program help.</p>
</div></blockquote>
<p><strong>–source-root</strong>=<em>PATH</em></p>
<blockquote>
<div><p>If given, load the project at the given source root path. If this option is not
given, the location of the project sources will be inferred from the location of
the <strong>llvm-build</strong> script itself.</p>
</div></blockquote>
<p><strong>–print-tree</strong></p>
<blockquote>
<div><p>Print the component tree for the project.</p>
</div></blockquote>
<p><strong>–write-library-table</strong></p>
<blockquote>
<div><p>Write out the C++ fragment which defines the components, library names, and
required libraries. This C++ fragment is built into llvm-config|llvm-config
in order to provide clients with the list of required libraries for arbitrary
component combinations.</p>
</div></blockquote>
<p><strong>–write-llvmbuild</strong></p>
<blockquote>
<div><p>Write out new <em>LLVMBuild.txt</em> files based on the loaded components. This is
useful for auto-upgrading the schema of the files. <strong>llvm-build</strong> will try to a
limited extent to preserve the comments which were written in the original
source file, although at this time it only preserves block comments that precede
the section names in the <em>LLVMBuild</em> files.</p>
</div></blockquote>
<p><strong>–write-cmake-fragment</strong></p>
<blockquote>
<div><p>Write out the LLVMBuild in the form of a CMake fragment, so it can easily be
consumed by the CMake based build system. The exact contents and format of this
file are closely tied to how LLVMBuild is integrated with CMake, see LLVM’s
top-level CMakeLists.txt.</p>
</div></blockquote>
<p><strong>–write-make-fragment</strong></p>
<blockquote>
<div><p>Write out the LLVMBuild in the form of a Makefile fragment, so it can easily be
consumed by a Make based build system. The exact contents and format of this
file are closely tied to how LLVMBuild is integrated with the Makefiles, see
LLVM’s Makefile.rules.</p>
</div></blockquote>
<p><strong>–llvmbuild-source-root</strong>=<em>PATH</em></p>
<blockquote>
<div><p>If given, expect the <em>LLVMBuild</em> files for the project to be rooted at the
given path, instead of inside the source tree itself. This option is primarily
designed for use in conjunction with <strong>–write-llvmbuild</strong> to test changes to
<em>LLVMBuild</em> schema.</p>
</div></blockquote>
</div>
<div class="section" id="exit-status">
<h2>EXIT STATUS<a class="headerlink" href="#exit-status" title="Permalink to this headline">¶</a></h2>
<p><strong>llvm-build</strong> exits with 0 if operation was successful. Otherwise, it will exist
with a non-zero value.</p>
</div>
</div>


            <div class="clearer"></div>
          </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="llvm-exegesis.html" title="llvm-exegesis - LLVM Machine Instruction Benchmark"
             >next</a> |</li>
        <li class="right" >
          <a href="lit.html" title="lit - LLVM Integrated Tester"
             >previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="../index.html">Documentation</a>&raquo;</li>

          <li class="nav-item nav-item-1"><a href="index.html" >LLVM Command Guide</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">llvm-build - LLVM Project Build Utility</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2003-2020, LLVM Project.
      Last updated on 2020-09-20.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
    </div>
  </body>
</html>